<% layout('/layout/default.html', {title: '字典管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-sitemap"></i>${dict.isNewRecord?'添加字典信息':'编辑字典信息'}
			</div>
		</div>
		<#form:form id="inputForm" model="${dict}" class="form-horizontal" action="${ctx}/sys/dict/save" method="post">
			<div class="box-body">
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="键值">
								<span class="required " aria-required="true">*</span> 键值：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="value" maxlength="100" class="form-control required" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="标签">
								<span class="required " aria-required="true">*</span> 标签：<i class="fa icon-question hide"></i>
							</label>
							<div class="col-sm-8">
								<#form:input path="label" maxlength="100" class="form-control required "/>
							</div>
						</div>
					</div>
				</div>
				
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="类型">
								<span class="required " aria-required="true">*</span> 类型：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="type"  maxlength="100" digits="true" class="form-control required" aria-required="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="描述">
								<span class="required " aria-required="true">*</span> 描述：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="description"  maxlength="100"  class="form-control required" aria-required="true"/>
							</div>
						</div>
					</div>
			</div>
			
			<div class="row">
				<div class="col-xs-6">
					<div class="form-group">
						<label class="control-label col-sm-4" title="排序">
							排序：<i class="fa icon-question hide"></i>
						</label>
						<div class="col-sm-8">
							<#form:input path="sort"  maxlength="10" class="form-control"/>
						</div>
					</div>
				</div>
			</div>
		
			<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="备注信息">
								备注:<i class="fa icon-question hide"></i>
							</label>
							<div class="col-sm-10">
								<#form:textarea path="remarks" rows="3" cols="32"  class="form-control"></#form:textarea>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
					<% if (hasPermi('sys:dict:edit')){ %>
						<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> 保 存</button>
					<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="window.parent.closeCurrentTabPage();"><i class="fa fa-reply-all"></i> 关 闭</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == 'true'){
				window.parent.closeCurrentTabPage(window.parent.refreshTab);
			}
		});
    }
});
</script>